package com.jhqc.pxsj.msa.sms.api;


import java.util.List;

import com.jhqc.pxsj.msa.sms.api.req.AddSendAllReq;
import com.jhqc.pxsj.msa.sms.api.req.AddSendReq;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import springfox.documentation.annotations.ApiIgnore;

import com.jhqc.pxsj.msa.pub.common.ObjectResp;
import com.jhqc.pxsj.msa.sms.api.dto.SmsDTO;
import com.jhqc.pxsj.msa.sms.api.dto.SmsTemplateDTO;
import com.jhqc.pxsj.msa.sms.api.url.SmsUrls;

import javax.validation.Valid;

/**
 * 短信接口 <p>
 * @author luochuan 
 * @date 2017年4月27日<br>
 * @version 1.0<br>
 */
@FeignClient(SmsUrls.SERVICE_NAME)
@ApiIgnore
@RequestMapping(value = SmsUrls.BASE_URL)
public interface SmsApi {
	
	@RequestMapping(value = SmsUrls.GET_CAPTCHA, method = RequestMethod.GET)
	ObjectResp<SmsDTO> getCaptcha();
	
	@RequestMapping(value = SmsUrls.FIND_TEMPLATE, method = RequestMethod.GET)
	ObjectResp<List<SmsTemplateDTO>> findTemplate();

	@RequestMapping(value = SmsUrls.SAVE_CAPTCHA, method = RequestMethod.GET)
	ObjectResp<SmsDTO> sendCaptcha(@RequestParam("mobile") String mobile, @RequestParam("appId")  String appId,@RequestParam("templateId")  String templateId,@RequestParam("item")  String item);

	@RequestMapping(method = RequestMethod.POST, value = SmsUrls.SEND_ONE_CAPTCHA)
	ObjectResp<SmsDTO> sendCaptcha(@Valid @RequestBody AddSendReq req);

	@ApiOperation(value = "群发短信")
	@RequestMapping(method = RequestMethod.POST, value = SmsUrls.SEND_ALL_CAPTCHA)
	ObjectResp<SmsDTO> sendAllCaptcha(@Valid @RequestBody AddSendAllReq req);
}
